package com.galaxy.order.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.order.domain.OrderPayment;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单支付业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = OrderPayment.class)
public class OrderPaymentBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 订单ID
     */
    @NotNull(message = "订单ID不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long orderId;

    /**
     * 订单编号
     */
    @NotBlank(message = "订单编号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String orderNo;

    /**
     * 支付单号
     */
    @NotBlank(message = "支付单号不能为空", groups = {AddGroup.class, EditGroup.class})
    private String paymentNo;

    /**
     * 支付方式(1:微信,2:支付宝,3:余额)
     */
    @NotNull(message = "支付方式不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer paymentType;

    /**
     * 支付金额
     */
    @NotNull(message = "支付金额不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal paymentAmount;

    /**
     * 第三方交易号
     */
    private String tradeNo;

    /**
     * 支付状态(0:待支付,1:支付成功,2:支付失败)
     */
    @NotNull(message = "支付状态不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer status;

    /**
     * 支付时间
     */
    private LocalDateTime payTime;

    /**
     * 租户ID
     */
    private String tenantId;
}
